package com.itheima.neibulei.demo04;

public class Demo {

    public static void main(String[] args) {
        Outer outer = new Outer();
        outer.method();

    }
}
class Outer {
    int i;

    public void sing() {
        System.out.println(i);


    }
    public void method(){
        long start = System.currentTimeMillis();
        //局部内部类的使用范围只能在自己所在的方法中
        class Inner {
            int j;

            public void dance() {
                System.out.println(i);
                sing();
            }
        }
        //创建对象
        Inner inner = new Inner();
        //调用方法
        inner.j=20;
        System.out.println(inner.j);
        inner.dance();
        long end = System.currentTimeMillis();
        System.out.println(end-start);
    }

}
